#ifndef SUDOKUCHROMOSOME_H_
#define SUDOKUCHROMOSOME_H_

#include <QList>
#include <QMetaType>

#include "IntegerChromosome.h"

/**
  * Class that represents chromosome sudoku data
  * Contains chromosome bits, fitness and methods to cross over and mutate.
  * @author Łukasz Szybka
  */
class SudokuChromosome : public IntegerChromosome
{
public:
    /**
      * Constructor
      */
    SudokuChromosome();
	
    /**
      * Constructor
      * @param size Lenght of chromosome
      */
    SudokuChromosome(int size, QList<QList<int> > * _cluesArr, QList<int> _cellIndexList1, int _sudokuDiagramSize);

    /**
      * Copy constructor
      * @param other SudokuChromosome to copy
      */
    SudokuChromosome(const SudokuChromosome &other);
    /**
      * Destructor
      */
    ~SudokuChromosome();

    SudokuChromosome& operator=(const SudokuChromosome& other);

    void setRandom();
    void mutate(int index);
    void additionalOperators(int position);

    Chromosome* duplicate() const;

protected:
       /**
        * Contains list of clues for all cells
	*/
	QList<QList<int> > * cluesArr;
        /**
          * Contains indexes of cells that are represented in chromosome
          */
        QList<int> cellIndexList;
        int sudokuDiagramSize;
        int sudokuDiagramSizeBox;
private:

        QList<int> createPossiblMatchCellsList(int index);
        int getRandomValue(int index);

};

Q_DECLARE_METATYPE(SudokuChromosome);

#endif /*SUDOKUCHROMOSOME_H_*/
